package br.edu.utfpr.backuptools.BackupTools.util.worker;

import javax.swing.SwingWorker;

import br.edu.utfpr.backuptools.BackupTools.controller.validator.RetornoValidacao;
import br.edu.utfpr.backuptools.BackupTools.model.pojo.Backup;
import br.edu.utfpr.backuptools.BackupTools.view.action.AbstractAction;
import br.edu.utfpr.backuptools.BackupTools.view.action.backup.GerarRestore;

/**
 * Worker responsável por fazer restore de um backup
 * 
 * @author Luan Malaguti Reffatti
 *
 */
public class WorkerRestore extends SwingWorker<Void, Void> {
	
	Backup restore;
	RetornoValidacao rv;
	
	public WorkerRestore(Backup restore)
	{
		this.restore = restore;
	}
	
	@Override
	protected Void doInBackground() throws Exception
	{
		AbstractAction<Backup> action = new GerarRestore();
		rv = action.execute(restore);
		return null;
	}
	
	public RetornoValidacao getRv(){
		return rv;
	}

}